package com.example.administrator.fragmentdome3;

import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        FragmentManager fm = getFragmentManager();
        ListTitleFragment listTitleFragment = (ListTitleFragment) fm.findFragmentById(R.id.fragment_content);
        if (listTitleFragment == null) {
            listTitleFragment = (ListTitleFragment) Fragment.instantiate(this, ListTitleFragment.class.getName());
            fm.beginTransaction().add(R.id.fragment_content, listTitleFragment, "list").commit();
        }
            }
}
